import Vue from "vue"
import VueRouter from "vue-router"
// import home from './modules/home'



Vue.use(VueRouter)

const router = new VueRouter({ //a
  // 跳转新页面，到顶页  (to, from, savedPosition)
  scrollBehavior: () => ({
    x: 0,
    y: 0
  }),
  routes:[
    {
      path: '/',
      name: 'main',
      component: () => import(/* webpackChunkName: "main" */ '@/pages/main'),
      redirect: '/index',
      children: []
    },
    {
      path: '/index',
      name: 'homeIndex',
      component: () => import(/* webpackChunkName: "main" */ '@/pages/home'),
    }

  ]
})
export default router
